<admintpl file="header"/>
<head/>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
   <ul class="nav nav-tabs">
       <li ><a href="{:U('Friend/index')}">全部朋友圈</a></li>

 	  <li ><a href="{:U('Forepart/Friendindex')}">推送账号</a></li>
 	   
 	  <li class="active"><a href="">修改账号</a></li>
  </ul>
        <form class="form-horizontal J_ajaxForm" action="{:U('forepart/FriendEdit')}" method="post" id="myform">

<style type="text/css">
 	.imgshow_left{ float:left; height:150px;} 
    .imgshow_right{float:left; height:150px; line-height:150px;}
	.imgshow_left img{ width:130px;}
 </style>

  <div class="table_full">
      <table width="100%" cellpadding="2" cellspacing="2">
          <tr>
              <th width="180">微信号名称</th>
              <td><input type="text" name="title" value="{$info.title}" class="input" ></input><span class="must_red">*</span></td>
          </tr>
          
          <tr>
              <th width="180">微信号</th>
              <td><input type="text" name="details[hao]" value="{$info.details.hao}" class="input" ></input><span class="must_red">*</span></td>
          </tr>
           <tr>
          	<th width="180">分类</th>
          	<td>
          		<select name="types">
          			<volist name="comm" id="vo">
          				<option value="{$key}" <if condition="$key eq $info['types']"> selected  </if>    >{$vo}</option>
          			</volist>
          		</select>
          	</td>
          </tr>
           <tr>
              <th width="180">好友数</th>
              <td><input type="text" name="details[friendnum]" value="{$info.details.friendnum}" class="input" ></input><span class="must_red">*</span></td>
          </tr>
          
          <tr>
              <th width="180">展示图片</th>
              <td>
              	<div class="imgshow_left">
              		<if condition="$info['img'] neq ''">
              			<img src="{$info.img}">
              		</if>
              	</div>
              	<div class="imgshow_right">
              		<input type="file" onchange="ImgUpload(this,'#imgurl');" id="avatar_uploder"  name="file"   />
              		<span class="must_red">*</span>
              		  <input type="hidden" name="img" value="{$info.img}" class="input" id="imgurl" ></input></td>
              	</div>  
              	<div style="clear:both"></div>            
            
          </tr>

          <tr>
              <th width="180">排序：</th>
              <td><input type="text" name="list" value="{$info.list}" class="input"></input><span class="must_red">*</span></td>
          </tr>
      </table>
  </div>
    <div class="form-actions">
    	<input type="hidden" name="id" value="{$info.id}" >
        <button type="submit" class="btn btn-primary btn_submit  J_ajax_submit_btn">提交</button>
        <a class="btn" href="__URL__">返回</a>
    </div>
    </form>

    
</div>
<script src="__ROOT__/statics/js/common.js"></script>
<script type="text/javascript">


function ImgUpload(obj,dr){
	var $fileinput=$(obj);
	var dr=$(dr);
	var id=$fileinput.attr("id");
	Wind.css("jcrop");
	Wind.use("ajaxfileupload","jcrop","noty",function(){
		$.ajaxFileUpload({
			url:"{:U('admin/forepart/updateImg')}",
			secureuri:false,
			fileElementId:id,
			dataType: 'json',
			data:{},
			success: function (data, status){
			
				if(data.status==1){
					
					dr.val(data.data.file);
	
					dr.parent().prev().html('<img src="'+data.data.file+'" />');
				}else{
					noty({text: data.info,
                		type:'error',
                		layout:'center'
                	});
				}
				
			},
			error: function (data, status, e){}
		});
	});

	return false;
}
</script>


</body>
</html>